package main

import (
	"os"

	"github.com/urfave/cli/v2"
)

func main() {
	app := cli.App{
		Name:  "puship",
		Usage: "获取公网地址,发送企业微信或邮件信息通知",
		Flags: []cli.Flag{
			&cli.StringFlag{
				Name:    "config",
				Aliases: []string{"c"},
				Value:   "configs/config.toml",
			},
			&cli.BoolFlag{
				Name:               "version",
				Aliases:            []string{"v"},
				Usage:              "打印版本号",
				DisableDefaultText: true,
			},
		},
		Action: func(ctx *cli.Context) error {
			app:=NewAPP(ctx)
			app.Run()
			return nil
		},
	}

	app.Run(os.Args)
}
